import { RouteRecordRaw } from 'vue-router';
import { Layout } from '@/router/constant';
import { Person } from '@vicons/ionicons5';
import { renderIcon } from '@/utils/index';

const routes: Array<RouteRecordRaw> = [
  {
    path: '/user',
    name: 'user',
    redirect: '/user/UserDept',
    component: Layout,
    meta: {
      title: '用户管理',
      sort: 6,
    },
    children: [
      {
        path: 'UserDept',
        name: 'UserDept',
        meta: {
          title: '组织结构',
          icon: renderIcon(Person),
        },
        component: () => import('@/views/UserDept/Index.vue'),
      },
      {
        path: 'UserRole',
        name: 'UserRole',
        meta: {
          title: '角色管理',
          icon: renderIcon(Person),
        },
        component: () => import('@/views/UserRole/Index.vue'),
      },
      {
        path: 'UserList',
        name: 'UserList',
        meta: {
          title: '人员管理',
          icon: renderIcon(Person),
        },
        component: () => import('@/views/UserList/Index.vue'),
      },
      {
        path: 'UserSchedul',
        name: 'UserSchedul',
        meta: {
          title: '排班管理',
          icon: renderIcon(Person),
        },
        component: () => import('@/views/UserSchedul/Index.vue'),
      },
    ],
  },
];

export default routes;
